Component({
  data: {
    selected: 0,
    color: "#8b8b8b",
    selectedColor: "#ef3941",
    list: [{
        "text": "首页",
        "pagePath": "/pages/index/index",
        "iconPath": "/images/home.png",
        "selectedIconPath": "/images/selected_home.png"
      },
      {
        "text": "分类",
        "pagePath": "/pages/category/index",
        "iconPath": "/images/category.png",
        "selectedIconPath": "/images/selected_category.png"
      }, {
        "text": "推荐",
        "pagePath": "/pages/recommend/index",
        "iconPath": "/images/recommend.png",
        "selectedIconPath": "/images/selected_recommend.png"
      }, {
        "text": "购物车",
        "pagePath": "/pages/cart/index",
        "iconPath": "/images/cart.png",
        "selectedIconPath": "/images/selected_cart.png"
      }, {
        "text": "我的",
        "pagePath": "/pages/me/index",
        "iconPath": "/images/me.png",
        "selectedIconPath": "/images/selected_me.png"
      }
    ]
  },
  methods: {
    switchTab(e) {
      console.log('00000');
      
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({
        url
      })
      // this.setData({
      //   selected: data.index
      // })
    }
  }
});